﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;

/// <summary>
/// Summary description for Class1
/// </summary>
/// 

namespace Bestlife.ERP.DataAccess
{

    public class Connection
    {
        public static SqlConnection con = new SqlConnection();

        public string connectionString = "data source=./SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true";
        public static SqlConnection connect(string connectionString)
        {
            if (con.State != System.Data.ConnectionState.Open)
            {

                con.ConnectionString = connectionString;
                con.Open();
            }
            else
            {
                return null;
            }
            return con;
        }
    }

}